using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using EditeurSyntaxiqueVocal.Forms;

namespace EditeurSyntaxiqueVocal.Languages.LanguageZ
{
    public sealed partial class OptionsSimulation : Form
    {
        private MainForm mainForm;

        public OptionsSimulation(MainForm mainForm)
        {
            if (mainForm == null) Close();

            InitializeComponent();
            MaximumSize = MinimumSize = Size;

            this.mainForm = mainForm;
            CheckBoxSimulatorOuiNon.Checked = mainForm.SimulatorAll;
            NumericUpDownLoop.Value = mainForm.SimulationPas;
        }

        private void ButtonOk_Click(object sender, EventArgs e)
        {
            mainForm.SimulatorAll = CheckBoxSimulatorOuiNon.Checked;
            mainForm.SimulationPas = (int)NumericUpDownLoop.Value;
            Close();
        }

        private void ButtonCnacel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void CheckBoxOuiNon_CheckedChanged(object sender, EventArgs e)
        {
            LabelLimiteLoop.Enabled = NumericUpDownLoop.Enabled = !CheckBoxSimulatorOuiNon.Checked;
        }
    }
}